package com.epower.dao.epowerkv.impl;


import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.ali.luna.commons.dao.BaseDAOImpl;
import com.epower.dao.epowerkv.EpowerKvDAO;
import com.epower.dataobject.EpowerKvDO;
import java.util.List;
/***
 * DAO实现层
 * @author QuickDev
 *
 */
@Scope("singleton")
@Component("epowerKvDAO")
public class EpowerKvDAOImpl extends BaseDAOImpl implements EpowerKvDAO {
    /***
     * 查询单个对象
     */
	@Override
	public EpowerKvDO getEpowerKvByOption(EpowerKvDO epowerKv) {
		return (EpowerKvDO)getSqlMapClientTemplate().queryForObject("EpowerKvDAOImpl.GET-EPOWERKV-BY-OPTION",epowerKv);
	}
    /***
     * 查询对象列表
     */
	@Override
	public List<EpowerKvDO> getEpowerKvListByOption(EpowerKvDO epowerKv) {
		return (List<EpowerKvDO>)getSqlMapClientTemplate().queryForList("EpowerKvDAOImpl.GET-EPOWERKVList-BY-OPTION",epowerKv);
	}
    /***
     * 根据id查询对象
     */
	@Override
	public EpowerKvDO getEpowerKvByKeyname(String keyname) {
		return (EpowerKvDO)getSqlMapClientTemplate().queryForObject("EpowerKvDAOImpl.GET-EPOWERKV-BY-KEYNAME",keyname);
	}
	
	/***
     * 删除操作
     */
	@Override
	public boolean deleteEpowerKvByKeyname(String keyname) {
		int num = getSqlMapClientTemplate().update("EpowerKvDAOImpl.DELETE-EPOWERKV-BY-KEYNAME",
				keyname);
		return num == 0 ? false : true;
	}
    /***
     * 查询数量
     */
	@Override
	public Integer getEpowerKvCountByOption(EpowerKvDO epowerKv) {
		return (Integer)getSqlMapClientTemplate().queryForObject("EpowerKvDAOImpl.GET-EPOWERKV-COUNT-BY-OPTION",epowerKv);
	}
    
    /***
     * 更新操作
     */
	@Override
	public boolean updateEpowerKvByOption(EpowerKvDO epowerKv) {
		int num = getSqlMapClientTemplate().update("EpowerKvDAOImpl.UPDATE-EPOWERKV-BY-OPTION",
				epowerKv);
		return num == 0 ? false : true;
	}
    /***
	 * 添加操作
	 * 
	 * @param 
	 * @return
	 */
	@Override
	public String addEpowerKv(EpowerKvDO epowerKv) {
		return (String)getSqlMapClientTemplate().insert("EpowerKvDAOImpl.ADD-EPOWERKV",
				epowerKv);
	}
}